package com.fourth.controller.api;

import com.fourth.service.UBGoodsService;
import com.ljx.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xiaoZhu
 * @version 1.0
 * @date 2023/3/2 10:33
 */
@Api(value = "commodity/UB/goods")
@RestController
@RequestMapping("commodity/UB/goods")
public class UBApiGoodsController {
    @Autowired
    private UBGoodsService ubGoodsService;
//    ${this.pageObj.pageCurrent}/${this.pageObj.pageSize}

    /**
     * 根据商铺id查询商铺内所有商品
     * @param id
     * @return
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "id", value = "", required = true)
    })
    @ApiOperation(value = "根据商铺id查询商铺内所有商品", notes = "根据商铺id查询商铺内所有商品", httpMethod = "GET")
    @GetMapping("/select")
    public Result select(String id
//            @RequestParam(defaultValue = "1") Integer currentPage,
//            @RequestParam(defaultValue = "5") Integer pageSize
    ){
        return ubGoodsService.selectAll(id);
    }

    /**
     * 根据id查询商户信息
     * @param id
     * @return
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "id", value = "", required = true)
    })
    @ApiOperation(value = "根据id查询商户信息", notes = "根据id查询商户信息", httpMethod = "GET")
    @GetMapping("selectB")
    public Result selectb(String id){

        return ubGoodsService.selectB(id);
    }
}
